﻿using System;
using System.Windows.Forms;

namespace ClockwiseClient
{
    class ClassMenu
    {
        FormMain formMain;
        MainMenu mainMenu;
        MenuItem menuItem1;
        MenuItem menuItem2;
        MenuItem menuItem3;
        MenuItem menuItem4;
        MenuItem menuItem5;
        MenuItem menuItem6;
        MenuItem menuItem7;
        MenuItem menuItem8;
        MenuItem menuItem9;
        MenuItem subMenuItem100;
        MenuItem subMenuItem108;
        MenuItem subMenuItem109;
        MenuItem subMenuItem200;
        MenuItem subMenuItem201;
        MenuItem subMenuItem202;
        MenuItem subMenuItem203;
        MenuItem subMenuItem204;
        MenuItem subMenuItem205;
        MenuItem subMenuItem206;
        MenuItem subMenuItem207;
        MenuItem subMenuItem208;
        MenuItem subMenuItem209;
        MenuItem subMenuItem210;
        MenuItem subMenuItem300;
        MenuItem subMenuItem301;
        MenuItem subMenuItem302;
        MenuItem subMenuItem303;
        MenuItem subMenuItem304;
        MenuItem subMenuItem305;
        MenuItem subMenuItem400;
        MenuItem subMenuItem401;
        MenuItem subMenuItem402;
        MenuItem subMenuItem403;
        MenuItem subMenuItem404;
        MenuItem subMenuItem405;
        MenuItem subMenuItem406;
        MenuItem subMenuItem407;
        MenuItem subMenuItem408;
        MenuItem subMenuItem500;
        MenuItem subMenuItem501;
        MenuItem subMenuItem502;
        MenuItem subMenuItem503;
        MenuItem subMenuItem504;
        MenuItem subMenuItem505;
        MenuItem subMenuItem506;
        MenuItem subMenuItem600;
        MenuItem subMenuItem601;
        MenuItem subMenuItem602;
        MenuItem subMenuItem700;
        MenuItem subMenuItem701;
        MenuItem subMenuItem702;
        MenuItem subMenuItem703;
        MenuItem subMenuItem704;
        MenuItem subMenuItem800;
        MenuItem subMenuItem801;
        MenuItem subMenuItem900;
        MenuItem subMenuItem901;
        MenuItem subMenuItem909;
        ClassStockData classStockData;

        public ClassMenu(FormMain formMain)
        {
            this.formMain = formMain;
            classStockData = (ClassStockData) ClassStock.GetInstance();
            InitMenu();
            InitSubMenu();
        }

        void InitMenu()
        {
            mainMenu = new MainMenu();
            menuItem1 = new MenuItem("系统");
            menuItem2 = new MenuItem("市场");
            menuItem3 = new MenuItem("板块");
            menuItem4 = new MenuItem("分析");
            menuItem5 = new MenuItem("筛选");
            menuItem6 = new MenuItem("巡航");
            menuItem7 = new MenuItem("工具");
            menuItem8 = new MenuItem("平台");
            menuItem9 = new MenuItem("帮助");
            mainMenu.MenuItems.Add(menuItem1);
            mainMenu.MenuItems.Add(menuItem2);
            mainMenu.MenuItems.Add(menuItem3);
            mainMenu.MenuItems.Add(menuItem4);
            mainMenu.MenuItems.Add(menuItem5);
            mainMenu.MenuItems.Add(menuItem6);
            mainMenu.MenuItems.Add(menuItem7);
            mainMenu.MenuItems.Add(menuItem8);
            mainMenu.MenuItems.Add(menuItem9);
        }

        void InitSubMenu()
        {
            subMenuItem100 = new MenuItem("交易系统");
            subMenuItem108 = new MenuItem("全屏");
            subMenuItem109 = new MenuItem("退出");
            subMenuItem100.Click += new EventHandler(subMenuItem100_Click);
            subMenuItem100.Shortcut = Shortcut.F12;
            subMenuItem108.Shortcut = Shortcut.AltBksp;
            subMenuItem108.Click += new EventHandler(subMenuItem108_Click);
            subMenuItem109.Shortcut = Shortcut.AltF4;
            subMenuItem109.Click += new EventHandler(subMenuItem109_Click);
            menuItem1.MenuItems.Add(subMenuItem100);
            menuItem1.MenuItems.Add(subMenuItem108);
            menuItem1.MenuItems.Add(subMenuItem109);

            subMenuItem200 = new MenuItem("A股 (" + classStockData.GetAgCount() + ")");
            subMenuItem201 = new MenuItem("B股 (" + classStockData.GetBgCount() + ")");
            subMenuItem202 = new MenuItem("深主板 (" + classStockData.GetSzbCount() + ")");
            subMenuItem203 = new MenuItem("沪主板 (" + classStockData.GetHzbCount() + ")");
            subMenuItem204 = new MenuItem("创业板 (" + classStockData.GetCybCount() + ")");
            subMenuItem205 = new MenuItem("科创板 (" + classStockData.GetKcbCount() + ")");
            subMenuItem206 = new MenuItem("中小板 (" + classStockData.GetZxbCount() + ")");
            subMenuItem207 = new MenuItem("ST股 (" + classStockData.GetStCount() + ")");
            subMenuItem208 = new MenuItem("基金 (" + classStockData.GetJjCount() + ")");
            subMenuItem209 = new MenuItem("指数 (" + classStockData.GetZsCount() + ")");
            subMenuItem210 = new MenuItem("其他 (" + classStockData.GetQtCount() + ")");
            subMenuItem200.Click += new EventHandler(subMenuItem200_Click);
            subMenuItem201.Click += new EventHandler(subMenuItem201_Click);
            subMenuItem202.Click += new EventHandler(subMenuItem202_Click);
            subMenuItem203.Click += new EventHandler(subMenuItem203_Click);
            subMenuItem204.Click += new EventHandler(subMenuItem204_Click);
            subMenuItem205.Click += new EventHandler(subMenuItem205_Click);
            subMenuItem206.Click += new EventHandler(subMenuItem206_Click);
            subMenuItem207.Click += new EventHandler(subMenuItem207_Click);
            subMenuItem208.Click += new EventHandler(subMenuItem208_Click);
            subMenuItem209.Click += new EventHandler(subMenuItem209_Click);
            subMenuItem210.Click += new EventHandler(subMenuItem210_Click);
            menuItem2.MenuItems.Add(subMenuItem200);
            menuItem2.MenuItems.Add(subMenuItem201);
            menuItem2.MenuItems.Add(subMenuItem202);
            menuItem2.MenuItems.Add(subMenuItem203);
            menuItem2.MenuItems.Add(subMenuItem204);
            menuItem2.MenuItems.Add(subMenuItem205);
            menuItem2.MenuItems.Add(subMenuItem206);
            menuItem2.MenuItems.Add(subMenuItem207);
            menuItem2.MenuItems.Add(subMenuItem208);
            menuItem2.MenuItems.Add(subMenuItem209);
            menuItem2.MenuItems.Add(subMenuItem210);

            subMenuItem300 = new MenuItem("中字头 (" + classStockData.GetZhongguoCount() + ")");
            subMenuItem301 = new MenuItem("豹子 (" + classStockData.GetBaoziCount() + ")");
            subMenuItem302 = new MenuItem("好汉成份 (" + classStockData.GetHaohanCount() + ")");
            subMenuItem303 = new MenuItem("猴股成份 (" + classStockData.GetHouguCount() + ")");
            subMenuItem304 = new MenuItem("自选股 (" + classStockData.GetZixuanCount() + ")");
            subMenuItem305 = new MenuItem("历史回顾 (" + classStockData.GetZixuanCount() + ")");
            subMenuItem300.Click += new EventHandler(subMenuItem300_Click);
            subMenuItem301.Click += new EventHandler(subMenuItem301_Click);
            subMenuItem302.Click += new EventHandler(subMenuItem302_Click);
            subMenuItem303.Click += new EventHandler(subMenuItem303_Click);
            subMenuItem304.Click += new EventHandler(subMenuItem304_Click);
            subMenuItem304.Shortcut = Shortcut.F6;
            subMenuItem305.Click += new EventHandler(subMenuItem305_Click);
            subMenuItem305.Shortcut = Shortcut.F7;
            menuItem3.MenuItems.Add(subMenuItem300);
            menuItem3.MenuItems.Add(subMenuItem301);
            menuItem3.MenuItems.Add(subMenuItem302);
            menuItem3.MenuItems.Add(subMenuItem303);
            menuItem3.MenuItems.Add(subMenuItem304);
            menuItem3.MenuItems.Add(subMenuItem305);

            subMenuItem400 = new MenuItem("好汉108");
            subMenuItem401 = new MenuItem("猴股888");
            subMenuItem402 = new MenuItem("上证综指");
            subMenuItem403 = new MenuItem("深圳成指");
            subMenuItem404 = new MenuItem("走势图");
            subMenuItem405 = new MenuItem("K线图");
            subMenuItem406 = new MenuItem("雷达图");
            subMenuItem407 = new MenuItem("股票信息");
            subMenuItem408 = new MenuItem("多股同列");
            subMenuItem400.Click += new EventHandler(subMenuItem400_Click);
            subMenuItem400.Shortcut = Shortcut.F1;
            subMenuItem401.Click += new EventHandler(subMenuItem401_Click);
            subMenuItem401.Shortcut = Shortcut.F2;
            subMenuItem402.Click += new EventHandler(subMenuItem402_Click);
            subMenuItem402.Shortcut = Shortcut.F3;
            subMenuItem403.Click += new EventHandler(subMenuItem403_Click);
            subMenuItem403.Shortcut = Shortcut.F4;
            subMenuItem404.Click += new EventHandler(subMenuItem404_Click);
            subMenuItem404.Shortcut = Shortcut.F5;
            subMenuItem405.Click += new EventHandler(subMenuItem405_Click);
            subMenuItem405.Shortcut = Shortcut.F8;
            subMenuItem406.Click += new EventHandler(subMenuItem406_Click);
            subMenuItem406.Shortcut = Shortcut.F9;
            subMenuItem407.Click += new EventHandler(subMenuItem407_Click);
            subMenuItem407.Shortcut = Shortcut.F10;
            subMenuItem408.Click += new EventHandler(subMenuItem408_Click);
            subMenuItem408.Shortcut = Shortcut.F11;
            menuItem4.MenuItems.Add(subMenuItem400);
            menuItem4.MenuItems.Add(subMenuItem401);
            menuItem4.MenuItems.Add(subMenuItem402);
            menuItem4.MenuItems.Add(subMenuItem403);
            menuItem4.MenuItems.Add(subMenuItem404);
            menuItem4.MenuItems.Add(subMenuItem405);
            menuItem4.MenuItems.Add(subMenuItem406);
            menuItem4.MenuItems.Add(subMenuItem407);
            menuItem4.MenuItems.Add(subMenuItem408);

            subMenuItem500 = new MenuItem("连板");
            subMenuItem501 = new MenuItem("正创新高");
            subMenuItem502 = new MenuItem("创新低弹起15%");
            subMenuItem503 = new MenuItem("正创新低");
            subMenuItem504 = new MenuItem("创新高回落15%");
            subMenuItem505 = new MenuItem("遗珠");
            subMenuItem506 = new MenuItem("好久不见");
            subMenuItem500.Click += new EventHandler(subMenuItem500_Click);
            subMenuItem501.Click += new EventHandler(subMenuItem501_Click);
            subMenuItem502.Click += new EventHandler(subMenuItem502_Click);
            subMenuItem503.Click += new EventHandler(subMenuItem503_Click);
            subMenuItem504.Click += new EventHandler(subMenuItem504_Click);
            subMenuItem505.Click += new EventHandler(subMenuItem505_Click);
            subMenuItem506.Click += new EventHandler(subMenuItem506_Click);
            menuItem5.MenuItems.Add(subMenuItem500);
            menuItem5.MenuItems.Add(subMenuItem501);
            menuItem5.MenuItems.Add(subMenuItem502);
            menuItem5.MenuItems.Add(subMenuItem503);
            menuItem5.MenuItems.Add(subMenuItem504);
            menuItem5.MenuItems.Add(subMenuItem505);
            menuItem5.MenuItems.Add(subMenuItem506);

            subMenuItem600 = new MenuItem("热搜");
            subMenuItem601 = new MenuItem("围观");
            subMenuItem602 = new MenuItem("信息地雷");
            subMenuItem600.Click += new EventHandler(subMenuItem600_Click);
            subMenuItem601.Click += new EventHandler(subMenuItem601_Click);
            subMenuItem602.Click += new EventHandler(subMenuItem602_Click);
            menuItem6.MenuItems.Add(subMenuItem600);
            menuItem6.MenuItems.Add(subMenuItem601);
            menuItem6.MenuItems.Add(subMenuItem602);

            subMenuItem700 = new MenuItem("录音");
            subMenuItem701 = new MenuItem("录屏");
            subMenuItem702 = new MenuItem("发推");
            subMenuItem703 = new MenuItem("群发短信");
            subMenuItem704 = new MenuItem("投资报告");
            subMenuItem700.Click += new EventHandler(subMenuItem700_Click);
            subMenuItem701.Click += new EventHandler(subMenuItem701_Click);
            subMenuItem702.Click += new EventHandler(subMenuItem702_Click);
            subMenuItem703.Click += new EventHandler(subMenuItem703_Click);
            subMenuItem704.Click += new EventHandler(subMenuItem704_Click);
            menuItem7.MenuItems.Add(subMenuItem700);
            menuItem7.MenuItems.Add(subMenuItem701);
            menuItem7.MenuItems.Add(subMenuItem702);
            menuItem7.MenuItems.Add(subMenuItem703);
            menuItem7.MenuItems.Add(subMenuItem704);

            subMenuItem800 = new MenuItem("竞猜");
            subMenuItem801 = new MenuItem("购买");
            subMenuItem800.Click += new EventHandler(subMenuItem800_Click);
            subMenuItem801.Click += new EventHandler(subMenuItem801_Click);
            menuItem8.MenuItems.Add(subMenuItem800);
            menuItem8.MenuItems.Add(subMenuItem801);

            subMenuItem900 = new MenuItem("操作手册");
            subMenuItem901 = new MenuItem("检查更新");
            subMenuItem909 = new MenuItem("关于 ...");
            subMenuItem900.Click += new EventHandler(subMenuItem900_Click);
            subMenuItem901.Click += new EventHandler(subMenuItem901_Click);
            subMenuItem909.Click += new EventHandler(subMenuItem909_Click);
            menuItem9.MenuItems.Add(subMenuItem900);
            menuItem9.MenuItems.Add(subMenuItem901);
            menuItem9.MenuItems.Add(subMenuItem909);

        }

        void subMenuItem100_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem100.Checked = true;
            formMain.ResetTrade();  // F12
        }

        void subMenuItem108_Click(object sender, EventArgs e)
        {
            CleanMarker();
            if (formMain.FormBorderStyle == FormBorderStyle.Sizable)
            {
                formMain.HideTools();
                formMain.FormBorderStyle = FormBorderStyle.None;
            }
            else
            {
                formMain.ShowTools();
                formMain.FormBorderStyle = FormBorderStyle.Sizable;
            }
        }

        void subMenuItem109_Click(object sender, EventArgs e)
        {
            formMain.Close();
        }

        void subMenuItem200_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem200.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_AG);
            formMain.ResetPrice();
        }

        void subMenuItem201_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem201.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_BG);
            formMain.ResetPrice();
        }

        void subMenuItem202_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem202.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_SZB);
            formMain.ResetPrice();
        }

        void subMenuItem203_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem203.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_HZB);
            formMain.ResetPrice();
        }

        void subMenuItem204_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem204.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_CYB);
            formMain.ResetPrice();
        }

        void subMenuItem205_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem205.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_KCB);
            formMain.ResetPrice();
        }

        void subMenuItem206_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem206.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_ZXB);
            formMain.ResetPrice();
        }

        void subMenuItem207_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem207.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_ST);
            formMain.ResetPrice();
        }

        void subMenuItem208_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem208.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_JJ);
            formMain.ResetPrice();
        }

        void subMenuItem209_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem209.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_ZS);
            formMain.ResetPrice();
        }

        void subMenuItem210_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem210.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_QT);
            formMain.ResetPrice();
        }

        void subMenuItem300_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem300.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_ZHONGGUO);
            formMain.ResetPrice();
        }

        void subMenuItem301_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem301.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_BAOZI);
            formMain.ResetPrice();
        }

        void subMenuItem302_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem302.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_HAOHAN);
            formMain.ResetPrice();
        }

        void subMenuItem303_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem303.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_HOUGU);
            formMain.ResetPrice();
        }

        void subMenuItem304_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem304.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_ZIXUAN);
            formMain.ResetPrice();
        }

        void subMenuItem305_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem305.Checked = true;
            classStockData.SetFilter(EnumFilter.FILTER_HISTORY);
            formMain.ResetPrice();
        }

        void subMenuItem400_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem400.Checked = true;
            formMain.ResetDapan(1);  // F1
        }

        void subMenuItem401_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem401.Checked = true;
            formMain.ResetDapan(2);  // F2
        }

        void subMenuItem402_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem402.Checked = true;
            formMain.ResetDapan(3);  // F3
        }

        void subMenuItem403_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem403.Checked = true;
            formMain.ResetDapan(4);  // F4
        }

        void subMenuItem404_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem404.Checked = true;
            formMain.ResetFenxi(1);  // F5
        }

        void subMenuItem405_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem405.Checked = true;
            formMain.ResetFenxi(2);  // F8
        }

        void subMenuItem406_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem406.Checked = true;
            formMain.ResetRadar();  // F9
        }

        void subMenuItem407_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem407.Checked = true;
            formMain.ResetInfor();  // F10
        }

        void subMenuItem408_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem408.Checked = true;
            formMain.ResetDuogu();  // F11
        }

        void subMenuItem500_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem500.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem501_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem501.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem502_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem502.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem503_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem503.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem504_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem504.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem505_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem505.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem506_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem506.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem600_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem600.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem601_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem601.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem602_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem602.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem700_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem700.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem701_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem701.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem702_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem702.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem703_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem703.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem704_Click(object sender, EventArgs e)
        {
            CleanMarker();
            subMenuItem704.Checked = true;
            formMain.Invalidate();
        }

        void subMenuItem800_Click(object sender, EventArgs e)
        {
            CleanMarker();
        }

        void subMenuItem801_Click(object sender, EventArgs e)
        {
            CleanMarker();
        }

        void subMenuItem900_Click(object sender, EventArgs e)
        {
            CleanMarker();
        }

        void subMenuItem901_Click(object sender, EventArgs e)
        {
            CleanMarker();
        }

        void subMenuItem909_Click(object sender, EventArgs e)
        {
            CleanMarker();
        }

        public MainMenu GetMainMenu()
        {
            return mainMenu;
        }

        void CleanMarker()
        {
            if (subMenuItem200.Checked) subMenuItem200.Checked = false;
            if (subMenuItem201.Checked) subMenuItem201.Checked = false;
            if (subMenuItem202.Checked) subMenuItem202.Checked = false;
            if (subMenuItem203.Checked) subMenuItem203.Checked = false;
            if (subMenuItem204.Checked) subMenuItem204.Checked = false;
            if (subMenuItem205.Checked) subMenuItem205.Checked = false;
            if (subMenuItem206.Checked) subMenuItem206.Checked = false;
            if (subMenuItem207.Checked) subMenuItem207.Checked = false;
            if (subMenuItem208.Checked) subMenuItem208.Checked = false;
            if (subMenuItem209.Checked) subMenuItem209.Checked = false;
            if (subMenuItem210.Checked) subMenuItem210.Checked = false;
            if (subMenuItem300.Checked) subMenuItem300.Checked = false;
            if (subMenuItem301.Checked) subMenuItem301.Checked = false;
            if (subMenuItem302.Checked) subMenuItem302.Checked = false;
            if (subMenuItem303.Checked) subMenuItem303.Checked = false;
            if (subMenuItem304.Checked) subMenuItem304.Checked = false;
            if (subMenuItem305.Checked) subMenuItem305.Checked = false;
            if (subMenuItem400.Checked) subMenuItem400.Checked = false;
            if (subMenuItem401.Checked) subMenuItem401.Checked = false;
            if (subMenuItem402.Checked) subMenuItem402.Checked = false;
            if (subMenuItem403.Checked) subMenuItem403.Checked = false;
            if (subMenuItem404.Checked) subMenuItem404.Checked = false;
            if (subMenuItem405.Checked) subMenuItem405.Checked = false;
            if (subMenuItem406.Checked) subMenuItem406.Checked = false;
            if (subMenuItem407.Checked) subMenuItem407.Checked = false;
            if (subMenuItem408.Checked) subMenuItem408.Checked = false;
            if (subMenuItem500.Checked) subMenuItem500.Checked = false;
            if (subMenuItem501.Checked) subMenuItem501.Checked = false;
            if (subMenuItem502.Checked) subMenuItem502.Checked = false;
            if (subMenuItem503.Checked) subMenuItem503.Checked = false;
            if (subMenuItem504.Checked) subMenuItem504.Checked = false;
            if (subMenuItem505.Checked) subMenuItem505.Checked = false;
            if (subMenuItem506.Checked) subMenuItem506.Checked = false;
        }

    }
}
